// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false


// 全局指令  v-focus
Vue.directive("focus",{
  bind:function(el){
    // 初始化设置
  },
  // 指令的钩子函数：元素被插入到节点中执行
  inserted:function(el,binding){
    el.focus();
    console.log(binding.name);
  },
  update(el) {
    console.log(el.value);
  },
  componentUpdated(el){
    console.log(el);
  },
  unbind(el){

  }
})

// 过滤去
Vue.filter("author",function(value){
  if(!value){
    return;
  }
  return value+ "    ———— 来自三体世界"
})

/* eslint-disable no-new */
new Vue({
  data:{
    gNum:100
  },
  computed:{
    getNum(){
      return 1000
    }
  },
  el: '#app',
  components: { App },
  template: '<App/>'
})
